//------------------------------------------------------------------------------
// Copyright (c) 2008 www.dnaide.com
// Licensed under the MIT (MIT-LICENSE.txt)
// defaultbutton_uncompressed.js
//------------------------------------------------------------------------------
jQuery.fn.defaultbutton = function(element)
{
	if(!element) return this;
	return this.bind("keypress",
		function(e)
		{
			var key = e.keyCode || e.charCode;
			if(key == 13)
			{
				jQuery(element).click();
				return false;
			}
		}
	)
};

jQuery.fn.cancelbutton = function(element)
{
	if(!element) return this;
	return this.bind("keypress",
		function(e)
		{
			var key = e.keyCode || e.charCode;
			if(key == 27)
			{
				jQuery(element).click();
				return false;
			}
		}
	)
};
